home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Creative Review 28
/
Creative-Review-CD-ROM-28.iso
/
mac
/
kungfu
/
assets
/
game.dir
/
00007_Script_load class
< prev
next >
Wrap
Text File
|
1997-08-08
|
3KB
|
143 lines
-- load class
-- --------------------------------------------------
property list
property loadedlist
-- ==================================================
-- new method
-- --------------------------------------------------
on new me, props
minit me, props
return me
end mnew
-- ==================================================
-- minit method
-- --------------------------------------------------
on minit me
-- put "in minit load class"
set loadedlist = []
set list = data2list ( "load data" )
set alwayslist = [ #player ]
repeat with name in alwayslist
mload me, name
end repeat
-- put "out minit load class"
end minit
-- ==================================================
-- mload method
-- --------------------------------------------------
on mload me, which
-- put "in mload: " , which
-- mshowk me
set whichlist = getaprop ( list , which )
preloadmember the in of whichlist, the out of whichlist
add loadedlist, which
-- mshowk me
-- put "out mload: "
end mload
-- ==================================================
-- munload method
-- --------------------------------------------------
on munload me, which
-- put "in munload: " , which
-- mshowk me
set whichlist = getaprop ( list , which )
unloadmember the in of whichlist, the out of whichlist
deleteone loadedlist, which
-- mshowk me
-- put "out munload: "
end munload
-- ==================================================
-- mdispose method
-- --------------------------------------------------
on mdispose me
put "in mdispose: "
repeat with index = 1 to count ( list )
set name = getpropat ( list, index )
munload me, name
end repeat
put "out mdispose: "
end mdispose
-- ==================================================
-- mshowk method
-- --------------------------------------------------
on mshowk me
put the freebytes / 1024
end mshowk
-- ==================================================
-- mwhich method
-- --------------------------------------------------
on mwhich me, castname
-- put "in mwhich" , castname
if integerp ( castname ) then set thenum = castname
else set thenum = the number of cast castname
-- put thenum
repeat with index = 1 to count ( list )
set thename = getpropat ( list , index )
set thelist = getat ( list, index )
-- put thename, thelist
set in = the number of cast the in of thelist
set out = the number of cast the out of thelist
-- put in , out
if ( thenum >= in ) and ( thenum <= out ) then
-- put castname && thename
return thename
exit repeat
end if
end repeat
return false
-- put "out mwhich"
end mwhich